home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / earthlink / nscomm / java40.jar / netscape / net / URLOutputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-11-03  |  822 b   |  41 lines

  1. package netscape.net;
  2.  
  3. import java.io.IOException;
  4. import java.io.OutputStream;
  5.  
  6. public class URLOutputStream extends OutputStream {
  7.    protected URLConnection connection;
  8.  
  9.    public URLOutputStream(URLConnection var1) {
  10.       this.connection = var1;
  11.    }
  12.  
  13.    protected native void open() throws IOException;
  14.  
  15.    public native void write(int var1) throws IOException;
  16.  
  17.    public void write(byte[] var1) throws IOException {
  18.       this.writeBytes(var1, 0, var1.length);
  19.    }
  20.  
  21.    public void write(byte[] var1, int var2, int var3) throws IOException {
  22.       this.writeBytes(var1, var2, var3);
  23.    }
  24.  
  25.    private native void writeBytes(byte[] var1, int var2, int var3) throws IOException;
  26.  
  27.    public void close() throws IOException {
  28.       this.pClose();
  29.       this.connection.currentOutputStream = null;
  30.    }
  31.  
  32.    public native void pClose() throws IOException;
  33.  
  34.    protected void finalize() {
  35.       try {
  36.          this.close();
  37.       } catch (IOException var1) {
  38.       }
  39.    }
  40. }
  41.